﻿using Microsoft.Xna.Framework;

namespace kompot_wtf
{
    public class Chainsaw : Pikap
    {
        public void Load(Vector2 playerPosition)
        {
            do
            {
                Position = new Vector2(((float)WTF.Random.NextDouble() - 0.5f) * 3000, ((float)WTF.Random.NextDouble() - 0.5f) * 3000);
            }
            while (Position.Length() < 500);
            Position += playerPosition;

            base.Load("Textures//chainsaw");
        }

        public override void Load()
        {
            Position = new Vector2(((float)WTF.Random.NextDouble() - 0.5f) * 1000, ((float)WTF.Random.NextDouble() - 0.5f) * 1000);

            base.Load("Textures//chainsaw");
        }

        public override void Trigger(Player player)
        {
            player.GiveChainsaw();
            GameState.ChangeState(GameState.State.ZOMBIES_ESCAPE);
            Sounds.pause_steps();
            Sounds.play_fanfare();

            WTF.Instance.RemoveAllChainsaws();
        }
    }
}
